# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=sandy
pkgver=6.531ab16
pkgrel=6
groups=('blackarch' 'blackarch-scanner' 'blackarch-crypto' 'blackarch-mobile')
pkgdesc='An open-source Samsung phone encryption assessment framework'
url='https://github.com/donctl/sandy'
arch=('any')
license=('GPL2')
makedepends=('git')
depends=('python2' 'python2-pexpect' 'python2-pbkdf2' 'python2-pycryptodome')
source=("git+https://github.com/donctl/$pkgname.git")
options=('!strip')
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 main.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

